package com.example.demo.config;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalErrorHandler {

	@ExceptionHandler(Exception.class)
	@ResponseBody
	public String exception(HttpServletRequest req,Exception e) {
		return "服务器正忙！其实是除了异常"+e.getMessage();
	}
}
